local DebugOptionalCell = class("DebugOptionalCell",function() return ccui.Layout:create() end)

function DebugOptionalCell:ctor(size,defalut,desc)
	--self:setContentSize(size)
	local title = ccui.Text:create()
	title:setString(desc)
	title:setFontSize(20)
	title:setPositionX(100)
	title:setAnchorPoint(0,0.5)

	local checkbox = ccui.CheckBox:create("public/public_choosekuang.png","public/public_black.png",0)
	checkbox:onEvent(function(event) 
		if self._switchCallback then
			self._switchCallback(event.name=="selected")
		end
	end)
	checkbox:setSelected(defalut)
	checkbox:setPositionX(30)
	checkbox:setAnchorPoint(0,0.5)

	self:addChild(title)
	self:addChild(checkbox)
end


function DebugOptionalCell:setSwitchCallback(cb)
	self._switchCallback = cb
end


return DebugOptionalCell